#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
typedef long long LL;
const int N = 1e6 + 10;
vector<int>ans;
LL arr[N];
int n;
map<LL, int>mp;
int main()
{
	cin >> n;
	for (int i = 1; i <= n * n; i++) {
		cin >> arr[i];
		mp[arr[i]]++;
	}
	if (n == 1) {
		cout << n << endl;
		return 0;
	}
	int ma = -1e9;
	for (int i = 1; i <= n * n; i++) {
		if (mp[arr[i]] == 1 ){
			ans.push_back(arr[i]);
		}
		else if (mp[arr[i]] % 2 == 1) {
			ans.push_back(arr[i]);
		}
		ma = max(ma, mp[arr[i]]);
	}
	sort(ans.begin(), ans.end());
	ans.erase(unique(ans.begin(), ans.end()), ans.end());
	/*for (auto x : ans) {
		cout << x << " ";
	}
	cout << endl;*/
	while (ans.size() < n) {
		ans.push_back(ma);
	}
	sort(ans.begin(), ans.end());
	for (auto x : ans) {
		cout << x << " ";
	}
	return 0;
}